<template>
	<h2>App父级组件</h2>
	<button @click="isShow = !isShow">点击切换</button>
	<hr />
	<Child v-if="isShow" />
</template>

<script lang="ts">
import { defineComponent, ref } from "vue"
// 引入子级组件
import Child from "./components/Child.vue"

export default defineComponent({
	name: "App",
	components: {
		Child
	},
	setup(props) {
		const isShow = ref(true)
		return {
			isShow
		}
	}
})
</script>

<style></style>
